/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  @endpointMap = {
    cn-beijing = 'ahas.cn-beijing.aliyuncs.com',
    cn-zhangjiakou = 'ahas.cn-zhangjiakou.aliyuncs.com',
    cn-hangzhou = 'ahas.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'ahas.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'ahas.cn-shenzhen.aliyuncs.com',
    ap-southeast-1 = 'ahas.ap-southeast-1.aliyuncs.com',
    cn-hongkong = 'ahas.cn-hongkong.aliyuncs.com',
    eu-central-1 = 'ahas.eu-central-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('ahas-openapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckExperimentRunnableRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  experimentId?: string(name='ExperimentId'),
  nameSpace?: string(name='NameSpace'),
}

model CheckExperimentRunnableResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckExperimentRunnableResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckExperimentRunnableResponseBody(name='body'),
}

async function checkExperimentRunnableWithOptions(request: CheckExperimentRunnableRequest, runtime: Util.RuntimeOptions): CheckExperimentRunnableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckExperimentRunnable',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkExperimentRunnable(request: CheckExperimentRunnableRequest): CheckExperimentRunnableResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkExperimentRunnableWithOptions(request, runtime);
}

model CreateDegradeRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  enable?: boolean(name='Enable'),
  halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
  halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
  minRequestAmount?: int32(name='MinRequestAmount'),
  namespace?: string(name='Namespace'),
  recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
  resource?: string(name='Resource'),
  slowRtMs?: int32(name='SlowRtMs'),
  statDurationMs?: int32(name='StatDurationMs'),
  strategy?: int32(name='Strategy'),
  threshold?: float(name='Threshold'),
}

model CreateDegradeRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
    halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
    minRequestAmount?: int32(name='MinRequestAmount'),
    namespace?: string(name='Namespace'),
    recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    slowRtMs?: int32(name='SlowRtMs'),
    statDurationMs?: int32(name='StatDurationMs'),
    strategy?: int32(name='Strategy'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateDegradeRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateDegradeRuleResponseBody(name='body'),
}

async function createDegradeRuleWithOptions(request: CreateDegradeRuleRequest, runtime: Util.RuntimeOptions): CreateDegradeRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.halfOpenBaseAmountPerStep)) {
    query['HalfOpenBaseAmountPerStep'] = request.halfOpenBaseAmountPerStep;
  }
  if (!Util.isUnset(request.halfOpenRecoveryStepNum)) {
    query['HalfOpenRecoveryStepNum'] = request.halfOpenRecoveryStepNum;
  }
  if (!Util.isUnset(request.minRequestAmount)) {
    query['MinRequestAmount'] = request.minRequestAmount;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.recoveryTimeoutMs)) {
    query['RecoveryTimeoutMs'] = request.recoveryTimeoutMs;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.slowRtMs)) {
    query['SlowRtMs'] = request.slowRtMs;
  }
  if (!Util.isUnset(request.statDurationMs)) {
    query['StatDurationMs'] = request.statDurationMs;
  }
  if (!Util.isUnset(request.strategy)) {
    query['Strategy'] = request.strategy;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDegradeRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDegradeRule(request: CreateDegradeRuleRequest): CreateDegradeRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDegradeRuleWithOptions(request, runtime);
}

model CreateExperimentRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  definition?: string(name='Definition'),
  description?: string(name='Description'),
  name?: string(name='Name'),
  nameSpace?: string(name='NameSpace'),
  tags?: [ string ](name='Tags'),
  workspaces?: [ string ](name='Workspaces'),
}

model CreateExperimentResponseBody = {
  code?: string(name='Code'),
  experimentId?: string(name='ExperimentId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateExperimentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateExperimentResponseBody(name='body'),
}

async function createExperimentWithOptions(request: CreateExperimentRequest, runtime: Util.RuntimeOptions): CreateExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.workspaces)) {
    query['Workspaces'] = request.workspaces;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperiment',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createExperiment(request: CreateExperimentRequest): CreateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createExperimentWithOptions(request, runtime);
}

model CreateFlowRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  controlBehavior?: int32(name='ControlBehavior'),
  enable?: boolean(name='Enable'),
  limitOrigin?: string(name='LimitOrigin'),
  maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
  namespace?: string(name='Namespace'),
  refResource?: string(name='RefResource'),
  relationStrategy?: int32(name='RelationStrategy'),
  resource?: string(name='Resource'),
  threshold?: float(name='Threshold'),
  thresholdMode?: int32(name='ThresholdMode'),
  warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
}

model CreateFlowRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
    clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
    clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
    clusterMode?: boolean(name='ClusterMode'),
    clusterThresholdType?: int32(name='ClusterThresholdType'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationMs?: int32(name='StatDurationMs'),
    threshold?: float(name='Threshold'),
    thresholdMode?: int32(name='ThresholdMode'),
    warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateFlowRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateFlowRuleResponseBody(name='body'),
}

async function createFlowRuleWithOptions(request: CreateFlowRuleRequest, runtime: Util.RuntimeOptions): CreateFlowRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.controlBehavior)) {
    query['ControlBehavior'] = request.controlBehavior;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.limitOrigin)) {
    query['LimitOrigin'] = request.limitOrigin;
  }
  if (!Util.isUnset(request.maxQueueingTimeMs)) {
    query['MaxQueueingTimeMs'] = request.maxQueueingTimeMs;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.refResource)) {
    query['RefResource'] = request.refResource;
  }
  if (!Util.isUnset(request.relationStrategy)) {
    query['RelationStrategy'] = request.relationStrategy;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  if (!Util.isUnset(request.thresholdMode)) {
    query['ThresholdMode'] = request.thresholdMode;
  }
  if (!Util.isUnset(request.warmUpPeriodSec)) {
    query['WarmUpPeriodSec'] = request.warmUpPeriodSec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFlowRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFlowRule(request: CreateFlowRuleRequest): CreateFlowRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFlowRuleWithOptions(request, runtime);
}

model CreateHotParamItemsRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  items?: string(name='Items'),
  ruleId?: long(name='RuleId'),
}

model CreateHotParamItemsResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    burstCount?: int32(name='BurstCount'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    metricType?: int32(name='MetricType'),
    namespace?: string(name='Namespace'),
    paramFlowItemList?: [ 
      {
        itemType?: string(name='ItemType'),
        itemValue?: string(name='ItemValue'),
        threshold?: float(name='Threshold'),
      }
    ](name='ParamFlowItemList'),
    paramIdx?: int32(name='ParamIdx'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationSec?: long(name='StatDurationSec'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateHotParamItemsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateHotParamItemsResponseBody(name='body'),
}

async function createHotParamItemsWithOptions(request: CreateHotParamItemsRequest, runtime: Util.RuntimeOptions): CreateHotParamItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.items)) {
    query['Items'] = request.items;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHotParamItems',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createHotParamItems(request: CreateHotParamItemsRequest): CreateHotParamItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHotParamItemsWithOptions(request, runtime);
}

model CreateHotParamRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  burstCount?: int32(name='BurstCount'),
  controlBehavior?: int32(name='ControlBehavior'),
  enable?: boolean(name='Enable'),
  maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
  metricType?: int32(name='MetricType'),
  namespace?: string(name='Namespace'),
  paramIdx?: int32(name='ParamIdx'),
  resource?: string(name='Resource'),
  statDurationSec?: long(name='StatDurationSec'),
  threshold?: float(name='Threshold'),
}

model CreateHotParamRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    burstCount?: int32(name='BurstCount'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    metricType?: int32(name='MetricType'),
    namespace?: string(name='Namespace'),
    paramFlowItemList?: [ 
      {
        itemType?: string(name='ItemType'),
        itemValue?: string(name='ItemValue'),
        threshold?: float(name='Threshold'),
      }
    ](name='ParamFlowItemList'),
    paramIdx?: int32(name='ParamIdx'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationSec?: long(name='StatDurationSec'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateHotParamRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateHotParamRuleResponseBody(name='body'),
}

async function createHotParamRuleWithOptions(request: CreateHotParamRuleRequest, runtime: Util.RuntimeOptions): CreateHotParamRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.burstCount)) {
    query['BurstCount'] = request.burstCount;
  }
  if (!Util.isUnset(request.controlBehavior)) {
    query['ControlBehavior'] = request.controlBehavior;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.maxQueueingTimeMs)) {
    query['MaxQueueingTimeMs'] = request.maxQueueingTimeMs;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.paramIdx)) {
    query['ParamIdx'] = request.paramIdx;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.statDurationSec)) {
    query['StatDurationSec'] = request.statDurationSec;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHotParamRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createHotParamRule(request: CreateHotParamRuleRequest): CreateHotParamRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHotParamRuleWithOptions(request, runtime);
}

model CreateIsolationRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  enable?: boolean(name='Enable'),
  limitOrigin?: string(name='LimitOrigin'),
  namespace?: string(name='Namespace'),
  refResource?: string(name='RefResource'),
  relationStrategy?: int32(name='RelationStrategy'),
  resource?: string(name='Resource'),
  threshold?: float(name='Threshold'),
}

model CreateIsolationRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateIsolationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIsolationRuleResponseBody(name='body'),
}

async function createIsolationRuleWithOptions(request: CreateIsolationRuleRequest, runtime: Util.RuntimeOptions): CreateIsolationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.limitOrigin)) {
    query['LimitOrigin'] = request.limitOrigin;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.refResource)) {
    query['RefResource'] = request.refResource;
  }
  if (!Util.isUnset(request.relationStrategy)) {
    query['RelationStrategy'] = request.relationStrategy;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIsolationRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIsolationRule(request: CreateIsolationRuleRequest): CreateIsolationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIsolationRuleWithOptions(request, runtime);
}

model CreateSystemRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  enable?: boolean(name='Enable'),
  metricType?: int32(name='MetricType'),
  namespace?: string(name='Namespace'),
  threshold?: float(name='Threshold'),
}

model CreateSystemRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    enable?: boolean(name='Enable'),
    metricType?: int32(name='MetricType'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateSystemRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSystemRuleResponseBody(name='body'),
}

async function createSystemRuleWithOptions(request: CreateSystemRuleRequest, runtime: Util.RuntimeOptions): CreateSystemRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSystemRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSystemRule(request: CreateSystemRuleRequest): CreateSystemRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSystemRuleWithOptions(request, runtime);
}

model DeleteDegradeRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DeleteDegradeRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteDegradeRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDegradeRuleResponseBody(name='body'),
}

async function deleteDegradeRuleWithOptions(request: DeleteDegradeRuleRequest, runtime: Util.RuntimeOptions): DeleteDegradeRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDegradeRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDegradeRule(request: DeleteDegradeRuleRequest): DeleteDegradeRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDegradeRuleWithOptions(request, runtime);
}

model DeleteFlowRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DeleteFlowRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteFlowRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteFlowRuleResponseBody(name='body'),
}

async function deleteFlowRuleWithOptions(request: DeleteFlowRuleRequest, runtime: Util.RuntimeOptions): DeleteFlowRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFlowRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFlowRule(request: DeleteFlowRuleRequest): DeleteFlowRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFlowRuleWithOptions(request, runtime);
}

model DeleteHotParamRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DeleteHotParamRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteHotParamRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteHotParamRuleResponseBody(name='body'),
}

async function deleteHotParamRuleWithOptions(request: DeleteHotParamRuleRequest, runtime: Util.RuntimeOptions): DeleteHotParamRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHotParamRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteHotParamRule(request: DeleteHotParamRuleRequest): DeleteHotParamRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHotParamRuleWithOptions(request, runtime);
}

model DeleteIsolationRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DeleteIsolationRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteIsolationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIsolationRuleResponseBody(name='body'),
}

async function deleteIsolationRuleWithOptions(request: DeleteIsolationRuleRequest, runtime: Util.RuntimeOptions): DeleteIsolationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIsolationRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIsolationRule(request: DeleteIsolationRuleRequest): DeleteIsolationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIsolationRuleWithOptions(request, runtime);
}

model DeleteSystemRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DeleteSystemRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteSystemRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSystemRuleResponseBody(name='body'),
}

async function deleteSystemRuleWithOptions(request: DeleteSystemRuleRequest, runtime: Util.RuntimeOptions): DeleteSystemRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSystemRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSystemRule(request: DeleteSystemRuleRequest): DeleteSystemRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSystemRuleWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage'),
}

model DescribeRegionsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  regions?: [ 
    {
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint'),
      regionId?: string(name='RegionId'),
    }
  ](name='Regions'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DisableDegradeRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DisableDegradeRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
    halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
    minRequestAmount?: int32(name='MinRequestAmount'),
    namespace?: string(name='Namespace'),
    recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    slowRtMs?: int32(name='SlowRtMs'),
    statDurationMs?: int32(name='StatDurationMs'),
    strategy?: int32(name='Strategy'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableDegradeRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableDegradeRuleResponseBody(name='body'),
}

async function disableDegradeRuleWithOptions(request: DisableDegradeRuleRequest, runtime: Util.RuntimeOptions): DisableDegradeRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableDegradeRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableDegradeRule(request: DisableDegradeRuleRequest): DisableDegradeRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableDegradeRuleWithOptions(request, runtime);
}

model DisableFlowRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DisableFlowRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
    clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
    clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
    clusterMode?: boolean(name='ClusterMode'),
    clusterThresholdType?: int32(name='ClusterThresholdType'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationMs?: int32(name='StatDurationMs'),
    threshold?: float(name='Threshold'),
    warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableFlowRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableFlowRuleResponseBody(name='body'),
}

async function disableFlowRuleWithOptions(request: DisableFlowRuleRequest, runtime: Util.RuntimeOptions): DisableFlowRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableFlowRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableFlowRule(request: DisableFlowRuleRequest): DisableFlowRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableFlowRuleWithOptions(request, runtime);
}

model DisableHotParamRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DisableHotParamRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    burstCount?: int32(name='BurstCount'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    metricType?: int32(name='MetricType'),
    namespace?: string(name='Namespace'),
    paramFlowItemList?: [ 
      {
        itemType?: string(name='ItemType'),
        itemValue?: string(name='ItemValue'),
        threshold?: float(name='Threshold'),
      }
    ](name='ParamFlowItemList'),
    paramIdx?: int32(name='ParamIdx'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationSec?: long(name='StatDurationSec'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableHotParamRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableHotParamRuleResponseBody(name='body'),
}

async function disableHotParamRuleWithOptions(request: DisableHotParamRuleRequest, runtime: Util.RuntimeOptions): DisableHotParamRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableHotParamRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableHotParamRule(request: DisableHotParamRuleRequest): DisableHotParamRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableHotParamRuleWithOptions(request, runtime);
}

model DisableIsolationRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DisableIsolationRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableIsolationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableIsolationRuleResponseBody(name='body'),
}

async function disableIsolationRuleWithOptions(request: DisableIsolationRuleRequest, runtime: Util.RuntimeOptions): DisableIsolationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableIsolationRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableIsolationRule(request: DisableIsolationRuleRequest): DisableIsolationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableIsolationRuleWithOptions(request, runtime);
}

model DisableSystemRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model DisableSystemRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    enable?: boolean(name='Enable'),
    metricType?: int32(name='MetricType'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableSystemRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableSystemRuleResponseBody(name='body'),
}

async function disableSystemRuleWithOptions(request: DisableSystemRuleRequest, runtime: Util.RuntimeOptions): DisableSystemRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableSystemRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableSystemRule(request: DisableSystemRuleRequest): DisableSystemRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableSystemRuleWithOptions(request, runtime);
}

model EnableDegradeRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model EnableDegradeRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
    halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
    minRequestAmount?: int32(name='MinRequestAmount'),
    namespace?: string(name='Namespace'),
    recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    slowRtMs?: int32(name='SlowRtMs'),
    statDurationMs?: int32(name='StatDurationMs'),
    strategy?: int32(name='Strategy'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableDegradeRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableDegradeRuleResponseBody(name='body'),
}

async function enableDegradeRuleWithOptions(request: EnableDegradeRuleRequest, runtime: Util.RuntimeOptions): EnableDegradeRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableDegradeRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableDegradeRule(request: EnableDegradeRuleRequest): EnableDegradeRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableDegradeRuleWithOptions(request, runtime);
}

model EnableFlowRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model EnableFlowRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
    clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
    clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
    clusterMode?: boolean(name='ClusterMode'),
    clusterThresholdType?: int32(name='ClusterThresholdType'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationMs?: int32(name='StatDurationMs'),
    threshold?: float(name='Threshold'),
    warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableFlowRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableFlowRuleResponseBody(name='body'),
}

async function enableFlowRuleWithOptions(request: EnableFlowRuleRequest, runtime: Util.RuntimeOptions): EnableFlowRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableFlowRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableFlowRule(request: EnableFlowRuleRequest): EnableFlowRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableFlowRuleWithOptions(request, runtime);
}

model EnableHotParamRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model EnableHotParamRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    burstCount?: int32(name='BurstCount'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    metricType?: int32(name='MetricType'),
    namespace?: string(name='Namespace'),
    paramFlowItemList?: [ 
      {
        itemType?: string(name='ItemType'),
        itemValue?: string(name='ItemValue'),
        threshold?: float(name='Threshold'),
      }
    ](name='ParamFlowItemList'),
    paramIdx?: int32(name='ParamIdx'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationSec?: long(name='StatDurationSec'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableHotParamRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableHotParamRuleResponseBody(name='body'),
}

async function enableHotParamRuleWithOptions(request: EnableHotParamRuleRequest, runtime: Util.RuntimeOptions): EnableHotParamRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableHotParamRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableHotParamRule(request: EnableHotParamRuleRequest): EnableHotParamRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableHotParamRuleWithOptions(request, runtime);
}

model EnableIsolationRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model EnableIsolationRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableIsolationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableIsolationRuleResponseBody(name='body'),
}

async function enableIsolationRuleWithOptions(request: EnableIsolationRuleRequest, runtime: Util.RuntimeOptions): EnableIsolationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableIsolationRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableIsolationRule(request: EnableIsolationRuleRequest): EnableIsolationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableIsolationRuleWithOptions(request, runtime);
}

model EnableSystemRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
}

model EnableSystemRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    enable?: boolean(name='Enable'),
    metricType?: int32(name='MetricType'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableSystemRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableSystemRuleResponseBody(name='body'),
}

async function enableSystemRuleWithOptions(request: EnableSystemRuleRequest, runtime: Util.RuntimeOptions): EnableSystemRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableSystemRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableSystemRule(request: EnableSystemRuleRequest): EnableSystemRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableSystemRuleWithOptions(request, runtime);
}

model ExecuteExperimentRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  definition?: string(name='Definition'),
  experimentId?: string(name='ExperimentId'),
  nameSpace?: string(name='NameSpace'),
}

model ExecuteExperimentResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  taskId?: string(name='TaskId'),
}

model ExecuteExperimentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExecuteExperimentResponseBody(name='body'),
}

async function executeExperimentWithOptions(request: ExecuteExperimentRequest, runtime: Util.RuntimeOptions): ExecuteExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteExperiment',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function executeExperiment(request: ExecuteExperimentRequest): ExecuteExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeExperimentWithOptions(request, runtime);
}

model FinishExperimentTaskRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  experimentTaskId?: string(name='ExperimentTaskId'),
  nameSpace?: string(name='NameSpace'),
}

model FinishExperimentTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FinishExperimentTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FinishExperimentTaskResponseBody(name='body'),
}

async function finishExperimentTaskWithOptions(request: FinishExperimentTaskRequest, runtime: Util.RuntimeOptions): FinishExperimentTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentTaskId)) {
    query['ExperimentTaskId'] = request.experimentTaskId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FinishExperimentTask',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function finishExperimentTask(request: FinishExperimentTaskRequest): FinishExperimentTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return finishExperimentTaskWithOptions(request, runtime);
}

model GetActivityTaskRequest {
  activityTaskId?: string(name='ActivityTaskId'),
  ahasRegionId?: string(name='AhasRegionId'),
  experimentTaskId?: string(name='ExperimentTaskId'),
  nameSpace?: string(name='NameSpace'),
}

model GetActivityTaskResponseBody = {
  activityId?: string(name='ActivityId'),
  activityName?: string(name='ActivityName'),
  endTime?: long(name='EndTime'),
  experimentTaskId?: string(name='ExperimentTaskId'),
  hosts?: [ 
    {
      data?: string(name='Data'),
      endTime?: long(name='EndTime'),
      errorMessage?: string(name='ErrorMessage'),
      expId?: string(name='ExpId'),
      hostIp?: string(name='HostIp'),
      result?: string(name='Result'),
      startTime?: long(name='StartTime'),
      state?: string(name='State'),
      taskId?: string(name='TaskId'),
    }
  ](name='Hosts'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  phase?: string(name='Phase'),
  requestId?: string(name='RequestId'),
  runResult?: string(name='RunResult'),
  startTime?: long(name='StartTime'),
  state?: string(name='State'),
  success?: boolean(name='Success'),
}

model GetActivityTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetActivityTaskResponseBody(name='body'),
}

async function getActivityTaskWithOptions(request: GetActivityTaskRequest, runtime: Util.RuntimeOptions): GetActivityTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activityTaskId)) {
    query['ActivityTaskId'] = request.activityTaskId;
  }
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentTaskId)) {
    query['ExperimentTaskId'] = request.experimentTaskId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetActivityTask',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getActivityTask(request: GetActivityTaskRequest): GetActivityTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getActivityTaskWithOptions(request, runtime);
}

model GetExperimentMetaRequest {
  experimentId?: string(name='ExperimentId'),
  nameSpace?: string(name='NameSpace'),
}

model GetExperimentMetaResponseBody = {
  code?: string(name='Code'),
  createTime?: string(name='CreateTime'),
  experimentId?: string(name='ExperimentId'),
  message?: string(name='Message'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  state?: string(name='State'),
  success?: boolean(name='Success'),
  tags?: [ string ](name='Tags'),
}

model GetExperimentMetaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetExperimentMetaResponseBody(name='body'),
}

async function getExperimentMetaWithOptions(request: GetExperimentMetaRequest, runtime: Util.RuntimeOptions): GetExperimentMetaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentMeta',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getExperimentMeta(request: GetExperimentMetaRequest): GetExperimentMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExperimentMetaWithOptions(request, runtime);
}

model GetExperimentTaskRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  experimentTaskId?: string(name='ExperimentTaskId'),
  nameSpace?: string(name='NameSpace'),
}

model GetExperimentTaskResponseBody = {
  activities?: [ 
    {
      activityId?: string(name='ActivityId'),
      activityName?: string(name='ActivityName'),
      checkState?: string(name='CheckState'),
      endTime?: long(name='EndTime'),
      experimentTaskId?: string(name='ExperimentTaskId'),
      phase?: string(name='Phase'),
      runResult?: string(name='RunResult'),
      startTime?: long(name='StartTime'),
      state?: string(name='State'),
      taskId?: string(name='TaskId'),
    }
  ](name='Activities'),
  experimentId?: string(name='ExperimentId'),
  experimentName?: string(name='ExperimentName'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  namespace?: string(name='Namespace'),
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
  startTime?: long(name='StartTime'),
  state?: string(name='State'),
  success?: boolean(name='Success'),
  taskId?: string(name='TaskId'),
}

model GetExperimentTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetExperimentTaskResponseBody(name='body'),
}

async function getExperimentTaskWithOptions(request: GetExperimentTaskRequest, runtime: Util.RuntimeOptions): GetExperimentTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentTaskId)) {
    query['ExperimentTaskId'] = request.experimentTaskId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentTask',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getExperimentTask(request: GetExperimentTaskRequest): GetExperimentTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExperimentTaskWithOptions(request, runtime);
}

model GetLicenseKeyRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  namespace?: string(name='Namespace'),
}

model GetLicenseKeyResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetLicenseKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetLicenseKeyResponseBody(name='body'),
}

async function getLicenseKeyWithOptions(request: GetLicenseKeyRequest, runtime: Util.RuntimeOptions): GetLicenseKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLicenseKey',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getLicenseKey(request: GetLicenseKeyRequest): GetLicenseKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLicenseKeyWithOptions(request, runtime);
}

model GetMetricsOfAppRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  endTime?: long(name='EndTime'),
  namespace?: string(name='Namespace'),
  startTime?: long(name='StartTime'),
}

model GetMetricsOfAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    innerMetrics?: [ 
      {
        blockedQps?: float(name='BlockedQps'),
        blockedQpsAvg?: float(name='BlockedQpsAvg'),
        blockedQpsMax?: float(name='BlockedQpsMax'),
        blockedQpsMin?: float(name='BlockedQpsMin'),
        blockedQpsP75?: float(name='BlockedQpsP75'),
        blockedQpsP95?: float(name='BlockedQpsP95'),
        blockedQpsP99?: float(name='BlockedQpsP99'),
        blockedQpsStd?: float(name='BlockedQpsStd'),
        count?: int32(name='Count'),
        exception?: float(name='Exception'),
        exceptionAvg?: float(name='ExceptionAvg'),
        exceptionMax?: float(name='ExceptionMax'),
        exceptionMin?: float(name='ExceptionMin'),
        exceptionP75?: float(name='ExceptionP75'),
        exceptionP95?: float(name='ExceptionP95'),
        exceptionP99?: float(name='ExceptionP99'),
        exceptionStd?: float(name='ExceptionStd'),
        passedQps?: float(name='PassedQps'),
        passedQpsAvg?: float(name='PassedQpsAvg'),
        passedQpsMax?: float(name='PassedQpsMax'),
        passedQpsMin?: float(name='PassedQpsMin'),
        passedQpsP75?: float(name='PassedQpsP75'),
        passedQpsP95?: float(name='PassedQpsP95'),
        passedQpsP99?: float(name='PassedQpsP99'),
        passedQpsStd?: float(name='PassedQpsStd'),
        rt?: float(name='Rt'),
        rtAvg?: float(name='RtAvg'),
        rtMax?: float(name='RtMax'),
        rtMin?: float(name='RtMin'),
        rtP75?: float(name='RtP75'),
        rtP95?: float(name='RtP95'),
        rtP99?: float(name='RtP99'),
        rtStd?: float(name='RtStd'),
        successQps?: float(name='SuccessQps'),
        successQpsAvg?: float(name='SuccessQpsAvg'),
        successQpsMax?: float(name='SuccessQpsMax'),
        successQpsMin?: float(name='SuccessQpsMin'),
        successQpsP75?: float(name='SuccessQpsP75'),
        successQpsP95?: float(name='SuccessQpsP95'),
        successQpsP99?: float(name='SuccessQpsP99'),
        successQpsStd?: float(name='SuccessQpsStd'),
        thread?: float(name='Thread'),
        threadAvg?: float(name='ThreadAvg'),
        threadMax?: float(name='ThreadMax'),
        threadMin?: float(name='ThreadMin'),
        threadP75?: float(name='ThreadP75'),
        threadP95?: float(name='ThreadP95'),
        threadP99?: float(name='ThreadP99'),
        threadStd?: float(name='ThreadStd'),
        timestamp?: long(name='Timestamp'),
      }
    ](name='InnerMetrics'),
    namespace?: string(name='Namespace'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetMetricsOfAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMetricsOfAppResponseBody(name='body'),
}

async function getMetricsOfAppWithOptions(request: GetMetricsOfAppRequest, runtime: Util.RuntimeOptions): GetMetricsOfAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMetricsOfApp',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMetricsOfApp(request: GetMetricsOfAppRequest): GetMetricsOfAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMetricsOfAppWithOptions(request, runtime);
}

model GetMetricsOfResourceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  endTime?: long(name='EndTime'),
  namespace?: string(name='Namespace'),
  resource?: string(name='Resource'),
  startTime?: long(name='StartTime'),
}

model GetMetricsOfResourceResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    innerMetrics?: [ 
      {
        blockedQps?: float(name='BlockedQps'),
        blockedQpsAvg?: float(name='BlockedQpsAvg'),
        blockedQpsMax?: float(name='BlockedQpsMax'),
        blockedQpsMin?: float(name='BlockedQpsMin'),
        blockedQpsP75?: float(name='BlockedQpsP75'),
        blockedQpsP95?: float(name='BlockedQpsP95'),
        blockedQpsP99?: float(name='BlockedQpsP99'),
        blockedQpsStd?: float(name='BlockedQpsStd'),
        count?: int32(name='Count'),
        exception?: float(name='Exception'),
        exceptionAvg?: float(name='ExceptionAvg'),
        exceptionMax?: float(name='ExceptionMax'),
        exceptionMin?: float(name='ExceptionMin'),
        exceptionP75?: float(name='ExceptionP75'),
        exceptionP95?: float(name='ExceptionP95'),
        exceptionP99?: float(name='ExceptionP99'),
        exceptionStd?: float(name='ExceptionStd'),
        passedQps?: float(name='PassedQps'),
        passedQpsAvg?: float(name='PassedQpsAvg'),
        passedQpsMax?: float(name='PassedQpsMax'),
        passedQpsMin?: float(name='PassedQpsMin'),
        passedQpsP75?: float(name='PassedQpsP75'),
        passedQpsP95?: float(name='PassedQpsP95'),
        passedQpsP99?: float(name='PassedQpsP99'),
        passedQpsStd?: float(name='PassedQpsStd'),
        rt?: float(name='Rt'),
        rtAvg?: float(name='RtAvg'),
        rtMax?: float(name='RtMax'),
        rtMin?: float(name='RtMin'),
        rtP75?: float(name='RtP75'),
        rtP95?: float(name='RtP95'),
        rtP99?: float(name='RtP99'),
        rtStd?: float(name='RtStd'),
        successQps?: float(name='SuccessQps'),
        successQpsAvg?: float(name='SuccessQpsAvg'),
        successQpsMax?: float(name='SuccessQpsMax'),
        successQpsMin?: float(name='SuccessQpsMin'),
        successQpsP75?: float(name='SuccessQpsP75'),
        successQpsP95?: float(name='SuccessQpsP95'),
        successQpsP99?: float(name='SuccessQpsP99'),
        successQpsStd?: float(name='SuccessQpsStd'),
        thread?: float(name='Thread'),
        threadAvg?: float(name='ThreadAvg'),
        threadMax?: float(name='ThreadMax'),
        threadMin?: float(name='ThreadMin'),
        threadP75?: float(name='ThreadP75'),
        threadP95?: float(name='ThreadP95'),
        threadP99?: float(name='ThreadP99'),
        threadStd?: float(name='ThreadStd'),
        timestamp?: long(name='Timestamp'),
      }
    ](name='InnerMetrics'),
    namespace?: string(name='Namespace'),
    resource?: string(name='Resource'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetMetricsOfResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMetricsOfResourceResponseBody(name='body'),
}

async function getMetricsOfResourceWithOptions(request: GetMetricsOfResourceRequest, runtime: Util.RuntimeOptions): GetMetricsOfResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMetricsOfResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMetricsOfResource(request: GetMetricsOfResourceRequest): GetMetricsOfResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMetricsOfResourceWithOptions(request, runtime);
}

model GetSentinelAppSumMetricRequest {
  acceptLanguage?: string(name='AcceptLanguage'),
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  endTime?: string(name='EndTime'),
  namespace?: string(name='Namespace'),
  startTime?: string(name='StartTime'),
}

model GetSentinelAppSumMetricResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  metricData?: {
    appName?: string(name='AppName'),
    avgRt?: float(name='AvgRt'),
    blockCount?: float(name='BlockCount'),
    machineCount?: long(name='MachineCount'),
    namespace?: string(name='Namespace'),
    passCount?: float(name='PassCount'),
    totalCount?: float(name='TotalCount'),
    userId?: string(name='UserId'),
  }(name='MetricData'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetSentinelAppSumMetricResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSentinelAppSumMetricResponseBody(name='body'),
}

async function getSentinelAppSumMetricWithOptions(request: GetSentinelAppSumMetricRequest, runtime: Util.RuntimeOptions): GetSentinelAppSumMetricResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSentinelAppSumMetric',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSentinelAppSumMetric(request: GetSentinelAppSumMetricRequest): GetSentinelAppSumMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSentinelAppSumMetricWithOptions(request, runtime);
}

model GetUserApplicationGroupsRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  applicationId?: string(name='ApplicationId'),
  nameSpace?: string(name='NameSpace'),
}

model GetUserApplicationGroupsResponseBody = {
  appGroups?: [ string ](name='AppGroups'),
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetUserApplicationGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserApplicationGroupsResponseBody(name='body'),
}

async function getUserApplicationGroupsWithOptions(request: GetUserApplicationGroupsRequest, runtime: Util.RuntimeOptions): GetUserApplicationGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.applicationId)) {
    query['ApplicationId'] = request.applicationId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserApplicationGroups',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserApplicationGroups(request: GetUserApplicationGroupsRequest): GetUserApplicationGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserApplicationGroupsWithOptions(request, runtime);
}

model GetUserApplicationsRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  namespace?: string(name='Namespace'),
}

model GetUserApplicationsResponseBody = {
  appNameAndIdPairs?: [ 
    {
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      appType?: int32(name='AppType'),
      scopeType?: int32(name='ScopeType'),
    }
  ](name='AppNameAndIdPairs'),
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetUserApplicationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserApplicationsResponseBody(name='body'),
}

async function getUserApplicationsWithOptions(request: GetUserApplicationsRequest, runtime: Util.RuntimeOptions): GetUserApplicationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserApplications',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserApplications(request: GetUserApplicationsRequest): GetUserApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserApplicationsWithOptions(request, runtime);
}

model GetUserWorkspaceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  namespace?: string(name='Namespace'),
}

model GetUserWorkspaceResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  workspaceList?: [ 
    {
      description?: string(name='Description'),
      name?: string(name='Name'),
      type?: int32(name='Type'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='WorkspaceList'),
}

model GetUserWorkspaceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserWorkspaceResponseBody(name='body'),
}

async function getUserWorkspaceWithOptions(request: GetUserWorkspaceRequest, runtime: Util.RuntimeOptions): GetUserWorkspaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserWorkspace',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserWorkspace(request: GetUserWorkspaceRequest): GetUserWorkspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserWorkspaceWithOptions(request, runtime);
}

model ListActiveAppsRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appType?: int32(name='AppType'),
  namespace?: string(name='Namespace'),
}

model ListActiveAppsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      ahasAppName?: string(name='AhasAppName'),
      appName?: string(name='AppName'),
      appType?: int32(name='AppType'),
      currentLevel?: int32(name='CurrentLevel'),
      dirtyLevel?: int32(name='DirtyLevel'),
      lastHealthPingTime?: long(name='LastHealthPingTime'),
      namespace?: string(name='Namespace'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListActiveAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListActiveAppsResponseBody(name='body'),
}

async function listActiveAppsWithOptions(request: ListActiveAppsRequest, runtime: Util.RuntimeOptions): ListActiveAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appType)) {
    query['AppType'] = request.appType;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListActiveApps',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listActiveApps(request: ListActiveAppsRequest): ListActiveAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listActiveAppsWithOptions(request, runtime);
}

model ListDegradeRulesOfAppRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
}

model ListDegradeRulesOfAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        enable?: boolean(name='Enable'),
        halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
        halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
        minRequestAmount?: int32(name='MinRequestAmount'),
        namespace?: string(name='Namespace'),
        recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        slowRtMs?: int32(name='SlowRtMs'),
        statDurationMs?: int32(name='StatDurationMs'),
        strategy?: int32(name='Strategy'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListDegradeRulesOfAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDegradeRulesOfAppResponseBody(name='body'),
}

async function listDegradeRulesOfAppWithOptions(request: ListDegradeRulesOfAppRequest, runtime: Util.RuntimeOptions): ListDegradeRulesOfAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDegradeRulesOfApp',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDegradeRulesOfApp(request: ListDegradeRulesOfAppRequest): ListDegradeRulesOfAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDegradeRulesOfAppWithOptions(request, runtime);
}

model ListDegradeRulesOfResourceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resource?: string(name='Resource'),
}

model ListDegradeRulesOfResourceResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        enable?: boolean(name='Enable'),
        halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
        halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
        minRequestAmount?: int32(name='MinRequestAmount'),
        namespace?: string(name='Namespace'),
        recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        slowRtMs?: int32(name='SlowRtMs'),
        statDurationMs?: int32(name='StatDurationMs'),
        strategy?: int32(name='Strategy'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListDegradeRulesOfResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDegradeRulesOfResourceResponseBody(name='body'),
}

async function listDegradeRulesOfResourceWithOptions(request: ListDegradeRulesOfResourceRequest, runtime: Util.RuntimeOptions): ListDegradeRulesOfResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDegradeRulesOfResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDegradeRulesOfResource(request: ListDegradeRulesOfResourceRequest): ListDegradeRulesOfResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDegradeRulesOfResourceWithOptions(request, runtime);
}

model ListExperimentMetasRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  nameSpace?: string(name='NameSpace'),
  page?: int32(name='Page'),
  size?: int32(name='Size'),
}

model ListExperimentMetasResponseBody = {
  code?: string(name='Code'),
  content?: [ 
    {
      createTime?: long(name='CreateTime'),
      experimentId?: string(name='ExperimentId'),
      name?: string(name='Name'),
      state?: string(name='State'),
      tags?: [ string ](name='Tags'),
    }
  ](name='Content'),
  currentPage?: int32(name='CurrentPage'),
  message?: string(name='Message'),
  pageSize?: int32(name='PageSize'),
  pages?: int32(name='Pages'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  total?: int32(name='Total'),
}

model ListExperimentMetasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListExperimentMetasResponseBody(name='body'),
}

async function listExperimentMetasWithOptions(request: ListExperimentMetasRequest, runtime: Util.RuntimeOptions): ListExperimentMetasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperimentMetas',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listExperimentMetas(request: ListExperimentMetasRequest): ListExperimentMetasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExperimentMetasWithOptions(request, runtime);
}

model ListFlowRulesOfAppRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
}

model ListFlowRulesOfAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
        clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
        clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
        clusterMode?: boolean(name='ClusterMode'),
        clusterThresholdType?: int32(name='ClusterThresholdType'),
        controlBehavior?: int32(name='ControlBehavior'),
        enable?: boolean(name='Enable'),
        limitOrigin?: string(name='LimitOrigin'),
        maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
        namespace?: string(name='Namespace'),
        refResource?: string(name='RefResource'),
        relationStrategy?: int32(name='RelationStrategy'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        statDurationMs?: int32(name='StatDurationMs'),
        threshold?: float(name='Threshold'),
        thresholdMode?: int32(name='ThresholdMode'),
        warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListFlowRulesOfAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListFlowRulesOfAppResponseBody(name='body'),
}

async function listFlowRulesOfAppWithOptions(request: ListFlowRulesOfAppRequest, runtime: Util.RuntimeOptions): ListFlowRulesOfAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFlowRulesOfApp',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFlowRulesOfApp(request: ListFlowRulesOfAppRequest): ListFlowRulesOfAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFlowRulesOfAppWithOptions(request, runtime);
}

model ListFlowRulesOfResourceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resource?: string(name='Resource'),
}

model ListFlowRulesOfResourceResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
        clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
        clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
        clusterMode?: boolean(name='ClusterMode'),
        clusterThresholdType?: int32(name='ClusterThresholdType'),
        controlBehavior?: int32(name='ControlBehavior'),
        enable?: boolean(name='Enable'),
        limitOrigin?: string(name='LimitOrigin'),
        maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
        namespace?: string(name='Namespace'),
        refResource?: string(name='RefResource'),
        relationStrategy?: int32(name='RelationStrategy'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        statDurationMs?: int32(name='StatDurationMs'),
        threshold?: float(name='Threshold'),
        thresholdMode?: int32(name='ThresholdMode'),
        warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListFlowRulesOfResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListFlowRulesOfResourceResponseBody(name='body'),
}

async function listFlowRulesOfResourceWithOptions(request: ListFlowRulesOfResourceRequest, runtime: Util.RuntimeOptions): ListFlowRulesOfResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFlowRulesOfResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFlowRulesOfResource(request: ListFlowRulesOfResourceRequest): ListFlowRulesOfResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFlowRulesOfResourceWithOptions(request, runtime);
}

model ListHotParamRulesOfAppRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
}

model ListHotParamRulesOfAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        burstCount?: int32(name='BurstCount'),
        controlBehavior?: int32(name='ControlBehavior'),
        enable?: boolean(name='Enable'),
        maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
        metricType?: int32(name='MetricType'),
        namespace?: string(name='Namespace'),
        paramFlowItemList?: [ 
          {
            itemType?: string(name='ItemType'),
            itemValue?: string(name='ItemValue'),
            threshold?: float(name='Threshold'),
          }
        ](name='ParamFlowItemList'),
        paramIdx?: int32(name='ParamIdx'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        statDurationSec?: long(name='StatDurationSec'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListHotParamRulesOfAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListHotParamRulesOfAppResponseBody(name='body'),
}

async function listHotParamRulesOfAppWithOptions(request: ListHotParamRulesOfAppRequest, runtime: Util.RuntimeOptions): ListHotParamRulesOfAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotParamRulesOfApp',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listHotParamRulesOfApp(request: ListHotParamRulesOfAppRequest): ListHotParamRulesOfAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotParamRulesOfAppWithOptions(request, runtime);
}

model ListHotParamRulesOfResourceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resource?: string(name='Resource'),
}

model ListHotParamRulesOfResourceResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        burstCount?: int32(name='BurstCount'),
        controlBehavior?: int32(name='ControlBehavior'),
        enable?: boolean(name='Enable'),
        maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
        metricType?: int32(name='MetricType'),
        namespace?: string(name='Namespace'),
        paramFlowItemList?: [ 
          {
            itemType?: string(name='ItemType'),
            itemValue?: string(name='ItemValue'),
            threshold?: float(name='Threshold'),
          }
        ](name='ParamFlowItemList'),
        paramIdx?: int32(name='ParamIdx'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        statDurationSec?: long(name='StatDurationSec'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListHotParamRulesOfResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListHotParamRulesOfResourceResponseBody(name='body'),
}

async function listHotParamRulesOfResourceWithOptions(request: ListHotParamRulesOfResourceRequest, runtime: Util.RuntimeOptions): ListHotParamRulesOfResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotParamRulesOfResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listHotParamRulesOfResource(request: ListHotParamRulesOfResourceRequest): ListHotParamRulesOfResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotParamRulesOfResourceWithOptions(request, runtime);
}

model ListIsolationRulesOfAppRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
}

model ListIsolationRulesOfAppResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        enable?: boolean(name='Enable'),
        limitOrigin?: string(name='LimitOrigin'),
        namespace?: string(name='Namespace'),
        refResource?: string(name='RefResource'),
        relationStrategy?: int32(name='RelationStrategy'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListIsolationRulesOfAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIsolationRulesOfAppResponseBody(name='body'),
}

async function listIsolationRulesOfAppWithOptions(request: ListIsolationRulesOfAppRequest, runtime: Util.RuntimeOptions): ListIsolationRulesOfAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIsolationRulesOfApp',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIsolationRulesOfApp(request: ListIsolationRulesOfAppRequest): ListIsolationRulesOfAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIsolationRulesOfAppWithOptions(request, runtime);
}

model ListIsolationRulesOfResourceRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resource?: string(name='Resource'),
}

model ListIsolationRulesOfResourceResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        enable?: boolean(name='Enable'),
        limitOrigin?: string(name='LimitOrigin'),
        namespace?: string(name='Namespace'),
        refResource?: string(name='RefResource'),
        relationStrategy?: int32(name='RelationStrategy'),
        resource?: string(name='Resource'),
        ruleId?: long(name='RuleId'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListIsolationRulesOfResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIsolationRulesOfResourceResponseBody(name='body'),
}

async function listIsolationRulesOfResourceWithOptions(request: ListIsolationRulesOfResourceRequest, runtime: Util.RuntimeOptions): ListIsolationRulesOfResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIsolationRulesOfResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIsolationRulesOfResource(request: ListIsolationRulesOfResourceRequest): ListIsolationRulesOfResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIsolationRulesOfResourceWithOptions(request, runtime);
}

model ListSystemRulesRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  appName?: string(name='AppName'),
  namespace?: string(name='Namespace'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
}

model ListSystemRulesResponseBody = {
  code?: string(name='Code'),
  data?: {
    datas?: [ 
      {
        appName?: string(name='AppName'),
        enable?: boolean(name='Enable'),
        metricType?: int32(name='MetricType'),
        namespace?: string(name='Namespace'),
        ruleId?: long(name='RuleId'),
        threshold?: float(name='Threshold'),
      }
    ](name='Datas'),
    pageIndex?: int32(name='PageIndex'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    totalPage?: int32(name='TotalPage'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListSystemRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSystemRulesResponseBody(name='body'),
}

async function listSystemRulesWithOptions(request: ListSystemRulesRequest, runtime: Util.RuntimeOptions): ListSystemRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSystemRules',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSystemRules(request: ListSystemRulesRequest): ListSystemRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSystemRulesWithOptions(request, runtime);
}

model ModifyDegradeRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
  halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
  minRequestAmount?: int32(name='MinRequestAmount'),
  recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
  ruleId?: long(name='RuleId'),
  slowRtMs?: int32(name='SlowRtMs'),
  statDurationMs?: int32(name='StatDurationMs'),
  strategy?: int32(name='Strategy'),
  threshold?: float(name='Threshold'),
}

model ModifyDegradeRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    halfOpenBaseAmountPerStep?: int32(name='HalfOpenBaseAmountPerStep'),
    halfOpenRecoveryStepNum?: int32(name='HalfOpenRecoveryStepNum'),
    minRequestAmount?: int32(name='MinRequestAmount'),
    namespace?: string(name='Namespace'),
    recoveryTimeoutMs?: int32(name='RecoveryTimeoutMs'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    slowRtMs?: int32(name='SlowRtMs'),
    statDurationMs?: int32(name='StatDurationMs'),
    strategy?: int32(name='Strategy'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyDegradeRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyDegradeRuleResponseBody(name='body'),
}

async function modifyDegradeRuleWithOptions(request: ModifyDegradeRuleRequest, runtime: Util.RuntimeOptions): ModifyDegradeRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.halfOpenBaseAmountPerStep)) {
    query['HalfOpenBaseAmountPerStep'] = request.halfOpenBaseAmountPerStep;
  }
  if (!Util.isUnset(request.halfOpenRecoveryStepNum)) {
    query['HalfOpenRecoveryStepNum'] = request.halfOpenRecoveryStepNum;
  }
  if (!Util.isUnset(request.minRequestAmount)) {
    query['MinRequestAmount'] = request.minRequestAmount;
  }
  if (!Util.isUnset(request.recoveryTimeoutMs)) {
    query['RecoveryTimeoutMs'] = request.recoveryTimeoutMs;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.slowRtMs)) {
    query['SlowRtMs'] = request.slowRtMs;
  }
  if (!Util.isUnset(request.statDurationMs)) {
    query['StatDurationMs'] = request.statDurationMs;
  }
  if (!Util.isUnset(request.strategy)) {
    query['Strategy'] = request.strategy;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDegradeRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyDegradeRule(request: ModifyDegradeRuleRequest): ModifyDegradeRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDegradeRuleWithOptions(request, runtime);
}

model ModifyFlowRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  controlBehavior?: string(name='ControlBehavior'),
  limitOrigin?: string(name='LimitOrigin'),
  maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
  namespace?: string(name='Namespace'),
  refResource?: string(name='RefResource'),
  relationStrategy?: int32(name='RelationStrategy'),
  ruleId?: long(name='RuleId'),
  threshold?: float(name='Threshold'),
  thresholdMode?: int32(name='ThresholdMode'),
  warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
}

model ModifyFlowRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    clusterEstimatedMaxQps?: float(name='ClusterEstimatedMaxQps'),
    clusterFallbackStrategy?: int32(name='ClusterFallbackStrategy'),
    clusterFallbackThreshold?: int32(name='ClusterFallbackThreshold'),
    clusterMode?: boolean(name='ClusterMode'),
    clusterThresholdType?: int32(name='ClusterThresholdType'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationMs?: int32(name='StatDurationMs'),
    threshold?: float(name='Threshold'),
    thresholdMode?: int32(name='ThresholdMode'),
    warmUpPeriodSec?: int32(name='WarmUpPeriodSec'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyFlowRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyFlowRuleResponseBody(name='body'),
}

async function modifyFlowRuleWithOptions(request: ModifyFlowRuleRequest, runtime: Util.RuntimeOptions): ModifyFlowRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.controlBehavior)) {
    query['ControlBehavior'] = request.controlBehavior;
  }
  if (!Util.isUnset(request.limitOrigin)) {
    query['LimitOrigin'] = request.limitOrigin;
  }
  if (!Util.isUnset(request.maxQueueingTimeMs)) {
    query['MaxQueueingTimeMs'] = request.maxQueueingTimeMs;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.refResource)) {
    query['RefResource'] = request.refResource;
  }
  if (!Util.isUnset(request.relationStrategy)) {
    query['RelationStrategy'] = request.relationStrategy;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  if (!Util.isUnset(request.thresholdMode)) {
    query['ThresholdMode'] = request.thresholdMode;
  }
  if (!Util.isUnset(request.warmUpPeriodSec)) {
    query['WarmUpPeriodSec'] = request.warmUpPeriodSec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyFlowRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyFlowRule(request: ModifyFlowRuleRequest): ModifyFlowRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyFlowRuleWithOptions(request, runtime);
}

model ModifyHotParamRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  burstCount?: int32(name='BurstCount'),
  controlBehavior?: int32(name='ControlBehavior'),
  enable?: boolean(name='Enable'),
  maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
  metricType?: int32(name='MetricType'),
  paramIdx?: int32(name='ParamIdx'),
  ruleId?: long(name='RuleId'),
  statDurationSec?: long(name='StatDurationSec'),
  threshold?: float(name='Threshold'),
}

model ModifyHotParamRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    burstCount?: int32(name='BurstCount'),
    controlBehavior?: int32(name='ControlBehavior'),
    enable?: boolean(name='Enable'),
    maxQueueingTimeMs?: int32(name='MaxQueueingTimeMs'),
    metricType?: int32(name='MetricType'),
    namespace?: string(name='Namespace'),
    paramFlowItemList?: [ 
      {
        itemType?: string(name='ItemType'),
        itemValue?: string(name='ItemValue'),
        threshold?: float(name='Threshold'),
      }
    ](name='ParamFlowItemList'),
    paramIdx?: int32(name='ParamIdx'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    statDurationSec?: long(name='StatDurationSec'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyHotParamRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyHotParamRuleResponseBody(name='body'),
}

async function modifyHotParamRuleWithOptions(request: ModifyHotParamRuleRequest, runtime: Util.RuntimeOptions): ModifyHotParamRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.burstCount)) {
    query['BurstCount'] = request.burstCount;
  }
  if (!Util.isUnset(request.controlBehavior)) {
    query['ControlBehavior'] = request.controlBehavior;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.maxQueueingTimeMs)) {
    query['MaxQueueingTimeMs'] = request.maxQueueingTimeMs;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.paramIdx)) {
    query['ParamIdx'] = request.paramIdx;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.statDurationSec)) {
    query['StatDurationSec'] = request.statDurationSec;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHotParamRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyHotParamRule(request: ModifyHotParamRuleRequest): ModifyHotParamRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHotParamRuleWithOptions(request, runtime);
}

model ModifyIsolationRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  limitOrigin?: string(name='LimitOrigin'),
  refResource?: string(name='RefResource'),
  relationStrategy?: int32(name='RelationStrategy'),
  ruleId?: long(name='RuleId'),
  threshold?: float(name='Threshold'),
}

model ModifyIsolationRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    appName?: string(name='AppName'),
    enable?: boolean(name='Enable'),
    limitOrigin?: string(name='LimitOrigin'),
    namespace?: string(name='Namespace'),
    refResource?: string(name='RefResource'),
    relationStrategy?: int32(name='RelationStrategy'),
    resource?: string(name='Resource'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyIsolationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyIsolationRuleResponseBody(name='body'),
}

async function modifyIsolationRuleWithOptions(request: ModifyIsolationRuleRequest, runtime: Util.RuntimeOptions): ModifyIsolationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.limitOrigin)) {
    query['LimitOrigin'] = request.limitOrigin;
  }
  if (!Util.isUnset(request.refResource)) {
    query['RefResource'] = request.refResource;
  }
  if (!Util.isUnset(request.relationStrategy)) {
    query['RelationStrategy'] = request.relationStrategy;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyIsolationRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyIsolationRule(request: ModifyIsolationRuleRequest): ModifyIsolationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyIsolationRuleWithOptions(request, runtime);
}

model ModifySystemRuleRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  ruleId?: long(name='RuleId'),
  threshold?: float(name='Threshold'),
}

model ModifySystemRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    enable?: boolean(name='Enable'),
    metricType?: int32(name='MetricType'),
    ruleId?: long(name='RuleId'),
    threshold?: float(name='Threshold'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifySystemRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySystemRuleResponseBody(name='body'),
}

async function modifySystemRuleWithOptions(request: ModifySystemRuleRequest, runtime: Util.RuntimeOptions): ModifySystemRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySystemRule',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySystemRule(request: ModifySystemRuleRequest): ModifySystemRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySystemRuleWithOptions(request, runtime);
}

model OpenAhasServiceRequest {
  ownerId?: long(name='OwnerId'),
}

model OpenAhasServiceResponseBody = {
  orderId?: string(name='OrderId'),
  requestId?: string(name='RequestId'),
}

model OpenAhasServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OpenAhasServiceResponseBody(name='body'),
}

async function openAhasServiceWithOptions(request: OpenAhasServiceRequest, runtime: Util.RuntimeOptions): OpenAhasServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenAhasService',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function openAhasService(request: OpenAhasServiceRequest): OpenAhasServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openAhasServiceWithOptions(request, runtime);
}

model PageableQueryExperimentTaskByClusterIdRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  clusterId?: string(name='ClusterId'),
  includeInvalidHost?: boolean(name='IncludeInvalidHost'),
  namespace?: string(name='Namespace'),
  page?: int32(name='Page'),
  regionId?: string(name='RegionId'),
  size?: int32(name='Size'),
}

model PageableQueryExperimentTaskByClusterIdResponseBody = {
  code?: string(name='Code'),
  currentPage?: int32(name='CurrentPage'),
  experimentTasks?: [ 
    {
      creator?: {
        subUserId?: string(name='SubUserId'),
        userId?: string(name='UserId'),
      }(name='Creator'),
      currentPhase?: string(name='CurrentPhase'),
      endTime?: long(name='EndTime'),
      experimentId?: string(name='ExperimentId'),
      experimentName?: string(name='ExperimentName'),
      extInfo?: {
        schedulerConfig?: {
          cronExpression?: string(name='CronExpression'),
          fixedTime?: string(name='FixedTime'),
        }(name='SchedulerConfig'),
      }(name='ExtInfo'),
      message?: string(name='Message'),
      namespace?: string(name='Namespace'),
      result?: string(name='Result'),
      startTime?: long(name='StartTime'),
      state?: string(name='State'),
      taskId?: string(name='TaskId'),
    }
  ](name='ExperimentTasks'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageSize?: int32(name='PageSize'),
  pages?: int32(name='Pages'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  total?: int32(name='Total'),
}

model PageableQueryExperimentTaskByClusterIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PageableQueryExperimentTaskByClusterIdResponseBody(name='body'),
}

async function pageableQueryExperimentTaskByClusterIdWithOptions(request: PageableQueryExperimentTaskByClusterIdRequest, runtime: Util.RuntimeOptions): PageableQueryExperimentTaskByClusterIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.includeInvalidHost)) {
    query['IncludeInvalidHost'] = request.includeInvalidHost;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PageableQueryExperimentTaskByClusterId',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pageableQueryExperimentTaskByClusterId(request: PageableQueryExperimentTaskByClusterIdRequest): PageableQueryExperimentTaskByClusterIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return pageableQueryExperimentTaskByClusterIdWithOptions(request, runtime);
}

model PageableQueryExperimentTaskByExperimentIdRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  experimentId?: string(name='ExperimentId'),
  namespace?: string(name='Namespace'),
  page?: int32(name='Page'),
  regionId?: string(name='RegionId'),
  size?: int32(name='Size'),
}

model PageableQueryExperimentTaskByExperimentIdResponseBody = {
  code?: string(name='Code'),
  currentPage?: int32(name='CurrentPage'),
  experimentTasks?: [ 
    {
      creator?: {
        subUserId?: string(name='SubUserId'),
        userId?: string(name='UserId'),
      }(name='Creator'),
      currentPhase?: string(name='CurrentPhase'),
      endTime?: long(name='EndTime'),
      experimentId?: string(name='ExperimentId'),
      experimentName?: string(name='ExperimentName'),
      extInfo?: {
        schedulerConfig?: {
          cronExpression?: string(name='CronExpression'),
          fixedTime?: string(name='FixedTime'),
        }(name='SchedulerConfig'),
      }(name='ExtInfo'),
      message?: string(name='Message'),
      namespace?: string(name='Namespace'),
      result?: string(name='Result'),
      startTime?: long(name='StartTime'),
      state?: string(name='State'),
      taskId?: string(name='TaskId'),
    }
  ](name='ExperimentTasks'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageSize?: int32(name='PageSize'),
  pages?: int32(name='Pages'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  total?: int32(name='Total'),
}

model PageableQueryExperimentTaskByExperimentIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PageableQueryExperimentTaskByExperimentIdResponseBody(name='body'),
}

async function pageableQueryExperimentTaskByExperimentIdWithOptions(request: PageableQueryExperimentTaskByExperimentIdRequest, runtime: Util.RuntimeOptions): PageableQueryExperimentTaskByExperimentIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PageableQueryExperimentTaskByExperimentId',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pageableQueryExperimentTaskByExperimentId(request: PageableQueryExperimentTaskByExperimentIdRequest): PageableQueryExperimentTaskByExperimentIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return pageableQueryExperimentTaskByExperimentIdWithOptions(request, runtime);
}

model PageableQueryUserExperimentRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  namespace?: string(name='Namespace'),
  page?: int32(name='Page'),
  regionId?: string(name='RegionId'),
  results?: [ string ](name='Results'),
  searchKey?: string(name='SearchKey'),
  size?: int32(name='Size'),
  state?: string(name='State'),
  tags?: [ string ](name='Tags'),
  workspaceId?: string(name='WorkspaceId'),
}

model PageableQueryUserExperimentResponseBody = {
  code?: string(name='Code'),
  currentPage?: int32(name='CurrentPage'),
  experimentList?: [ 
    {
      createTime?: long(name='CreateTime'),
      creator?: string(name='Creator'),
      experimentId?: string(name='ExperimentId'),
      miniApps?: [ string ](name='MiniApps'),
      name?: string(name='Name'),
      permission?: int32(name='Permission'),
      result?: string(name='Result'),
      state?: string(name='State'),
      tags?: [ string ](name='Tags'),
    }
  ](name='ExperimentList'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageSize?: int32(name='PageSize'),
  pages?: int32(name='Pages'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  total?: int32(name='Total'),
}

model PageableQueryUserExperimentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PageableQueryUserExperimentResponseBody(name='body'),
}

async function pageableQueryUserExperimentWithOptions(request: PageableQueryUserExperimentRequest, runtime: Util.RuntimeOptions): PageableQueryUserExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.results)) {
    query['Results'] = request.results;
  }
  if (!Util.isUnset(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PageableQueryUserExperiment',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pageableQueryUserExperiment(request: PageableQueryUserExperimentRequest): PageableQueryUserExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return pageableQueryUserExperimentWithOptions(request, runtime);
}

model PushExperimentTaskRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  experimentTaskId?: string(name='ExperimentTaskId'),
  nameSpace?: string(name='NameSpace'),
}

model PushExperimentTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model PushExperimentTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PushExperimentTaskResponseBody(name='body'),
}

async function pushExperimentTaskWithOptions(request: PushExperimentTaskRequest, runtime: Util.RuntimeOptions): PushExperimentTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.experimentTaskId)) {
    query['ExperimentTaskId'] = request.experimentTaskId;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushExperimentTask',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pushExperimentTask(request: PushExperimentTaskRequest): PushExperimentTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushExperimentTaskWithOptions(request, runtime);
}

model UpdateExperimentRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  definition?: string(name='Definition'),
  description?: string(name='Description'),
  experimentId?: string(name='ExperimentId'),
  name?: string(name='Name'),
  nameSpace?: string(name='NameSpace'),
  tags?: [ string ](name='Tags'),
}

model UpdateExperimentResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateExperimentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateExperimentResponseBody(name='body'),
}

async function updateExperimentWithOptions(request: UpdateExperimentRequest, runtime: Util.RuntimeOptions): UpdateExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperiment',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateExperiment(request: UpdateExperimentRequest): UpdateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateExperimentWithOptions(request, runtime);
}

model UpdateExperimentBasicInfoRequest {
  ahasRegionId?: string(name='AhasRegionId'),
  description?: string(name='Description'),
  experimentId?: string(name='ExperimentId'),
  name?: string(name='Name'),
  nameSpace?: string(name='NameSpace'),
  tags?: [ string ](name='Tags'),
  workspaces?: [ string ](name='Workspaces'),
}

model UpdateExperimentBasicInfoResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateExperimentBasicInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateExperimentBasicInfoResponseBody(name='body'),
}

async function updateExperimentBasicInfoWithOptions(request: UpdateExperimentBasicInfoRequest, runtime: Util.RuntimeOptions): UpdateExperimentBasicInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ahasRegionId)) {
    query['AhasRegionId'] = request.ahasRegionId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nameSpace)) {
    query['NameSpace'] = request.nameSpace;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.workspaces)) {
    query['Workspaces'] = request.workspaces;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentBasicInfo',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateExperimentBasicInfo(request: UpdateExperimentBasicInfoRequest): UpdateExperimentBasicInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateExperimentBasicInfoWithOptions(request, runtime);
}

